from tkintertable import TableCanvas, TableModel
import tkinter as tk
from tkinter import ttk
import random
from collections import OrderedDict

##data = {'rec1': {'col1': 99.88, 'col2': 108.79, 'label': 'rec1'},
##        'rec2': {'col1': 99.88, 'col2': 321.79, 'label': 'rec3'},
##        'rec3': {'col1': 29.88, 'col2': 408.79, 'label': 'rec2'}
##        }
import pandas as pd
import numpy as np
data=pd.DataFrame(np.random.randn(100,5))
##from tkintertable.Testing import sampledata
##data=sampledata()
###print(data)

class TestApp(ttk.Frame):
    """Basic test frame for the table"""

    def __init__(self, parent=None):
        self.parent = parent
        ttk.Frame.__init__(self)
        self.main = self.master
        self.main.geometry('800x500+200+100')
        self.main.title('Test')
        f = ttk.Frame(self.main)
        f.pack(fill=tk.BOTH,expand=1)
                
        table = TableCanvas(f)
        #table.importCSV('test.csv')
        print (table.model.columnNames)
        #table.model.data[1]['a'] = 'XX'
        #table.model.setValueAt('YY',0,2)
        table.show()
    def set_data(self,data):

        return

app=TestApp()
app.mainloop()